package com.tt.vtg.authn.otp.common;

public class GoogleAuthnInfo {

	private OTPMode mode;

	private String userName;

	private String secret;

	private String issuer;

	private String algorithm;

	private int digits;

	private int period;
	

	public GoogleAuthnInfo(OTPMode mode, String userName, String secret,
			String issuer, String algorithm, int digits, int period) {
		this.mode = mode;
		this.userName = userName;
		this.secret = secret;
		this.issuer = issuer;
		this.algorithm = algorithm;
		this.digits = digits;
		this.period = period;
	}

	public String getUrl() {
		StringBuilder sb = new StringBuilder("otpauth://");
		sb.append(mode).append("/").append(userName).append("?secret=")
				.append(secret).append("&issuer=").append(issuer)
				.append("&algorithm=").append(algorithm).append("&digits=")
				.append(digits).append("&period=").append(period);
		return sb.toString();
	}

	public OTPMode getMode() {
		return mode;
	}

	public void setMode(OTPMode mode) {
		this.mode = mode;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secrect) {
		this.secret = secrect;
	}

	public String getIssuer() {
		return issuer;
	}

	public void setIssuer(String issuer) {
		this.issuer = issuer;
	}

	public String getAlgorithm() {
		return algorithm;
	}

	public void setAlgorithm(String algorithm) {
		this.algorithm = algorithm;
	}

	public int getDigits() {
		return digits;
	}

	public void setDigits(int digits) {
		this.digits = digits;
	}

	public int getPeriod() {
		return period;
	}

	public void setPeriod(int period) {
		this.period = period;
	}

	@Override
	public String toString() {
		return "GoogleAuthnInfo [mode=" + mode + ", userName=" + userName
				+ ", secret=" + secret + ", issuer=" + issuer + ", algorithm="
				+ algorithm + ", digits=" + digits + ", period=" + period + "]";
	}

}
